home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Portable Patmos 1.1 / patmos-src / src / strcat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-19  |  2.1 KB  |  100 lines  |  [TEXT/KAHL]

  1. /*
  2.  
  3.  * Copyright (c) 1988 Regents of the University of California.
  4.  
  5.  * All rights reserved.
  6.  
  7.  *
  8.  
  9.  * Redistribution and use in source and binary forms, with or without
  10.  
  11.  * modification, are permitted provided that the following conditions
  12.  
  13.  * are met:
  14.  
  15.  * 1. Redistributions of source code must retain the above copyright
  16.  
  17.  *    notice, this list of conditions and the following disclaimer.
  18.  
  19.  * 2. Redistributions in binary form must reproduce the above copyright
  20.  
  21.  *    notice, this list of conditions and the following disclaimer in the
  22.  
  23.  *    documentation and/or other materials provided with the distribution.
  24.  
  25.  * 3. All advertising materials mentioning features or use of this software
  26.  
  27.  *    must display the following acknowledgement:
  28.  
  29.  *    This product includes software developed by the University of
  30.  
  31.  *    California, Berkeley and its contributors.
  32.  
  33.  * 4. Neither the name of the University nor the names of its contributors
  34.  
  35.  *    may be used to endorse or promote products derived from this software
  36.  
  37.  *    without specific prior written permission.
  38.  
  39.  *
  40.  
  41.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  42.  
  43.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  44.  
  45.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  46.  
  47.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  48.  
  49.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  50.  
  51.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  52.  
  53.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  54.  
  55.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  56.  
  57.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  58.  
  59.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  60.  
  61.  * SUCH DAMAGE.
  62.  
  63.  */
  64.  
  65.  
  66.  
  67. #if defined(LIBC_SCCS) && !defined(lint)
  68.  
  69. static char sccsid[] = "@(#)strcat.c    5.6 (Berkeley) 2/24/91";
  70.  
  71. #endif /* LIBC_SCCS and not lint */
  72.  
  73.  
  74.  
  75. #include <string.h>
  76.  
  77.  
  78. char *
  79.  
  80. strcat(s, append)
  81.  
  82.     register char *s;
  83.  
  84.     register const char *append;
  85.  
  86. {
  87.  
  88.     char *save = s;
  89.  
  90.  
  91.  
  92.     for (; *s; ++s);
  93.  
  94.     while (*s++ = *append++);
  95.  
  96.     return(save);
  97.  
  98. }
  99.  
  100.